package com.dsbj.mp.icardservice.service.attendance;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsbj.mp.icardservice.entity.Dayreport;
import com.dsbj.mp.icardservice.mapper.DayreportMapper;
import com.dsbj.mp.icardservice.utils.strprocess.ObjectParse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.*;

/**
 * 生成日考勤数据
 *
 * @author Caesar,cjw
 */
@Service
@Transactional
public class DayReportService extends ServiceImpl<DayreportMapper, Dayreport> {
	
	@Autowired
	private HttpServletRequest request;
	
	@Resource
	private DayreportMapper dayreportMapper;
	
	
	/**
	 * 分页查询dayreport信息。
	 * //@param page
	 * @param map
	 * @return
	 */
	public Page queryPage(Map<String,Object> map){
		List<Dayreport> list_dayreport=(List<Dayreport>) dayreportMapper.queryPage(map);
		int total=dayreportMapper.count(map);
		
		Page page=new Page();
		page.setCurrent(ObjectParse.parse_toInt_elseException(map.get("pageNum")));
		page.setSize(ObjectParse.parse_toInt_elseException(map.get("pageSize")));
		page.setRecords(list_dayreport);
		page.setTotal(total);
		return page;
	}
	
	
	
	
	
	
	
	
	
	
}
